<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增运输" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-transport-add"  class="form-horizontal">
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "销售员"/>：
    </label>
        <div class="col-sm-8"><input name="saleUserid" class="form-control" type="text" value="${bpmCrmTransport.saleUserid}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "销售订单编号"/>：
    </label>
        <div class="col-sm-8"><input name="saleOrderNumber" class="form-control" type="text" value="${bpmCrmTransport.saleOrderNumber}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "车辆识别号"/>：
    </label>
        <div class="col-sm-8"><input name="outCarVin" class="form-control" type="text" value="${bpmCrmTransport.outCarVin}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "车型"/>：
    </label>
        <div class="col-sm-8"><input name="outCarVehicle" class="form-control" type="text" value="${bpmCrmTransport.outCarVehicle}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "提车地点"/>：</label>
        <div class="col-sm-8">
            <select name="transportTakeCarPlace" class="form-control m-b" readonly="true" disabled>
                <#list dict.getType('sys_crm_takecarplace')>
                <#items as d>
                <#if d.status =='0' >
                <option  value="${d.dictValue}" text="${d.dictLabel}" <#if d.dictValue==(bpmCrmTransport.transportTakeCarPlace+'')?default("") >selected = "selected"</#if>>${d.dictLabel}</option>
                        </#if>
                    </#items>
                </#list>
            </select>
        </div>
    </div>
    <div class="form-group takeClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "选择同事"/>：
    </label>
        <div class="col-sm-8"><input name="transportSelectColleague" class="form-control" type="text" value="${bpmCrmTransport.transportSelectColleague}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "提车地址"/>：
    </label>
        <div class="col-sm-8"><input name="transportTakeCarAddress" class="form-control" type="text" value="${bpmCrmTransport.transportTakeCarAddress}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "提车电话"/>：
    </label>
        <div class="col-sm-8"><input name="transportTakeCarPhone" class="form-control" type="text" value="${bpmCrmTransport.transportTakeCarPhone}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "送车地点"/>：</label>
        <div class="col-sm-8">
            <select name="transportGiveCarPlace" class="form-control m-b" readonly="true" disabled>
                <#list dict.getType('sys_crm_takecarplace')>
                <#items as d>
                <#if d.status =='0' >
                <option  value="${d.dictValue}" text="${d.dictLabel}" <#if d.dictValue==(bpmCrmTransport.transportGiveCarPlace+'')?default("") >selected = "selected"</#if>>${d.dictLabel}</option>
                        </#if>
                    </#items>
                </#list>
            </select>
        </div>
    </div>
    <div class="form-group giveClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "选择同事"/>：
    </label>
        <div class="col-sm-8"><input name="transportGiveSelectColleague" class="form-control" type="text" value="${bpmCrmTransport.transportGiveSelectColleague}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "送车地址"/>：
    </label>
        <div class="col-sm-8"><input name="transportGiveCarAddress" class="form-control" type="text" value="${bpmCrmTransport.transportGiveCarAddress}" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "送车电话"/>：
    </label>
        <div class="col-sm-8"><input name="transportGiveCarPhone" class="form-control" type="text" value="${bpmCrmTransport.transportGiveCarPhone}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="transportInfoRemark" class="form-control" readOnly="true">${bpmCrmTransport.transportInfoRemark?default("")}</textarea>
        </div>
    </div>

    <#if bpmCrmTransport.processStatus==1 >
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "运输状态"/>：</label>
            <div class="col-sm-8">
                <@form.radio name="approvalCurrentStatus" dictType="sys_crm_transportstatus"  />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "状态备注"/>：</label>
            <div class="col-sm-8">
                <textarea name="approvalCurrentStatusMemo" class="form-control" required></textarea>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "计划提车时间"/>：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input class="form-control time-input" name="approvalPlanTakeCarTime"  data-type="date" data-format="yyyy-MM-dd" required type="text"  />
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "预计到达日"/>：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input class="form-control time-input" name="approvalPlanArriveTime"  data-type="date" data-format="yyyy-MM-dd" required type="text"  />
                </div>
            </div>
        </div>
        <div class="form-group"><label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "订单ID"/>：
        </label>
            <div class="col-sm-8"><input name="approvalOrderid" class="form-control" type="text" value="${bpmCrmTransport.approvalOrderid}"   >
            </div>
        </div>
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "调度费用"/>：
            </label>
                <div class="col-sm-8"><input name="approvalCentralDispatchFee" class="form-control" type="text"  required>
                </div>
            </div>
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "运输公司名字"/>：
            </label>
                <div class="col-sm-8"><input name="transportCompanyName" class="form-control" type="text"  required>
                </div>
            </div>
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "运输公司支票接收地址"/>：
            </label>
                <div class="col-sm-8"><input name="transportCompanyCheckAddress" class="form-control" type="text"  required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "邮寄方式"/>：</label>
                <div class="col-sm-8">
                    <@form.radio name="transportMail" dictType="sys_crm_expresscompany" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "备注"/>：</label>
                <div class="col-sm-8">
                    <textarea name="transportRemark" class="form-control" required></textarea>
                </div>
            </div>
    </#if>
<#if bpmCrmTransport.processStatus!=1 >

    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "运输状态"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="approvalCurrentStatus" dictType="sys_crm_transportstatus" readOnly="true" value="${bpmCrmTransport.approvalCurrentStatus}"  />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "状态备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="approvalCurrentStatusMemo" class="form-control" readonly="true">${bpmCrmTransport.approvalCurrentStatusMemo}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "计划提车时间"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control" name="approvalPlanTakeCarTime"  data-type="date" data-format="yyyy-MM-dd"  value="${(bpmCrmTransport.approvalPlanTakeCarTime?string('yyyy-MM-dd'))!}" readonly="true" type="text"  />
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计到达日"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control" name="approvalPlanArriveTime"  data-type="date" data-format="yyyy-MM-dd" value="${(bpmCrmTransport.approvalPlanArriveTime?string('yyyy-MM-dd'))!}" readonly="true" type="text"  />
            </div>
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "订单ID"/>：
    </label>
        <div class="col-sm-8"><input name="approvalOrderid" class="form-control" type="text" value="${bpmCrmTransport.approvalOrderid}"  readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "调度费用"/>：
    </label>
        <div class="col-sm-8"><input name="approvalCentralDispatchFee" class="form-control" type="text" value="${bpmCrmTransport.approvalCentralDispatchFee}" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "运输公司名字"/>：
    </label>
        <div class="col-sm-8"><input name="transportCompanyName" class="form-control" type="text" value="${bpmCrmTransport.transportCompanyName}" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "运输公司支票接收地址"/>：
    </label>
        <div class="col-sm-8"><input name="transportCompanyCheckAddress" class="form-control" type="text" value="${bpmCrmTransport.transportCompanyCheckAddress}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "邮寄方式"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="transportMail" dictType="sys_crm_expresscompany" value="${bpmCrmTransport.transportMail}"  readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="transportRemark" class="form-control" readonly="true">${bpmCrmTransport.transportRemark}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "付款日期"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control" name="cashierPayTime"  data-type="date" data-format="yyyy-MM-dd" value="${(bpmCrmTransport.cashierPayTime?string('yyyy-MM-dd'))!}" readonly="true" type="text" />
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "汇款方式"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="cashierPayMethod" dictType="sys_crm_remitmoney" readOnly="true" value="${bpmCrmTransport.cashierPayMethod}" />
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "证明"/>：
    </label>
        <div class="col-sm-8"><input name="cashierPayProofFilepath" class="form-control" type="text" value="${bpmCrmTransport.cashierPayProofFilepath}" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "收据单号"/>：
    </label>
        <div class="col-sm-8"><input name="cashierReceiptNumber" class="form-control" type="text" value="${bpmCrmTransport.cashierReceiptNumber}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="cashierPayMemo" class="form-control" readonly="true">${bpmCrmTransport.cashierPayMemo}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "支付结果"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="confirmPayMethod" dictType="sys_crm_isOrNo" readOnly="true" value="${bpmCrmTransport.confirmPayMethod}" />
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
    </label>
        <div class="col-sm-8"><input name="confirmPayAmount" class="form-control" type="text" value="${bpmCrmTransport.confirmPayAmount}"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="confirmPayMemo" class="form-control" readonly="true" >${bpmCrmTransport.confirmPayMemo}</textarea>
        </div>
    </div>

    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "付款总额"/>：
    </label>
        <div class="col-sm-8"><input name="confirmPaySum" class="form-control" type="text" value="${bpmCrmTransport.confirmPaySum}"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "运输备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="transportMemo" class="form-control" readonly="true">${bpmCrmTransport.transportMemo}</textarea>
        </div>
    </div>

    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "运输总费用"/>：
    </label>
        <div class="col-sm-8"><input name="transportTotalCost" class="form-control" type="text" value="${bpmCrmTransport.transportTotalCost}"  readonly="true">
        </div>
    </div>
</#if>
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    $(function () {
        var transportTakeCarPlace= $("[name='transportTakeCarPlace'] option:checked").val();
        var transportGiveCarPlace= $("[name='transportGiveCarPlace'] option:checked").val();
        console.log("transportTakeCarPlace",transportTakeCarPlace,"transportGiveCarPlace",transportGiveCarPlace)
        if(transportTakeCarPlace=="7"){
            $(".takeClass").show();
        }
        else if(transportGiveCarPlace=="7") {
            $(".giveClass").show();
        }
        else {
            $(".giveClass").hide();
            $(".takeClass").hide();
        }
    })
    var prefix = baseURL + "bpm/transport"
    $("#form-transport-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        opt.warning("流程实例未启动，无法创建此申请单");
        return;
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/view2", $('#form-transport-add').serialize());
        }
    }
    /**
     * 下拉选择框 回调函数案例
     * @param id
     * @param event
     * @param data
     */
    function selectCallback(id,event,data){
        console.log(data)
        if(id == "transportTakeCarPlace"){
            if(data[0].id=="7"){
                $(".takeClass").show();
            }
            else{
                $(".takeClass").hide();
            }
        }
        else if(id == "transportGiveCarPlace"){
            if(data[0].id=="7"){
                $(".giveClass").show();
            }
            else{
                $(".giveClass").hide();
            }
        }
    }
</script>
</@footer>
</@pageTheme>